Skip to content

docs: schema governance tooling#2319

Open
sarahxsanders wants to merge 2 commits intographql:sourcefrom
sarahxsanders:governance-tooling
Open

docs: schema governance tooling#2319
sarahxsanders wants to merge 2 commits intographql:sourcefrom
sarahxsanders:governance-tooling

Conversation

@sarahxsanders
Copy link
Contributor

Description

adds a new governance tooling and automation page to the Learn section under a new "Schema Governance" category:

  • guidance for schema registries, CI/CD validation, documentation generation, usage monitoring, developer tooling, metrics tracking, alerting, and rollback procedures

@vercel
Copy link

vercel bot commented Jan 25, 2026

@sarahxsanders is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@martinbonnin
Copy link
Contributor

@sarahxsanders were you looking into feedback already or should we wait a bit until this PR is not a draft?

@sarahxsanders sarahxsanders marked this pull request as ready for review February 17, 2026 22:33
@sarahxsanders
Copy link
Contributor Author

this one is ready too! @martinbonnin

Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. Nothing blocking. Thanks for looking into this ❤️

performance: "",
security: "",
federation: "",
"debug-errors": "Common GraphQL over HTTP Errors",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Set up a schema registry

A schema registry stores and versions your GraphQL schemas, acting as the source of truth for what's deployed. Without a registry, teams often discover breaking changes only after deployment, when clients start failing. A registry enables you to compare proposed changes against production schemas before merge, track which schema version each environment runs, and maintain an audit trail of who changed what and when.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd stay clear of "source of truth" as the deployment is the source of truth at the end of the day.

Suggested change
A schema registry stores and versions your GraphQL schemas, acting as the source of truth for what's deployed. Without a registry, teams often discover breaking changes only after deployment, when clients start failing. A registry enables you to compare proposed changes against production schemas before merge, track which schema version each environment runs, and maintain an audit trail of who changed what and when.
A schema registry stores and versions your GraphQL schemas. Without a registry, teams often discover breaking changes only after deployment, when clients start failing. A registry enables you to compare proposed changes against production schemas before merge, track which schema version each environment runs, and maintain an audit trail of who changed what and when.

Comment on lines +13 to +15
- **Hosted services** provide managed infrastructure with built-in features like schema composition for federation, usage analytics, and breaking change detection. They work well for teams that want to move fast without managing infrastructure. Consider data residency requirements and per-operation pricing at scale.
- **Self-hosted options** give you full control over data and costs. You'll need to handle deployment, scaling, and maintenance, but you avoid vendor lock-in and can customize behavior. This works well for organizations with strict compliance requirements or existing infrastructure expertise.
- **Lightweight approaches** work for smaller teams: store schemas in Git with validation in CI, use a shared S3 bucket with versioned objects, or build a simple API that stores schemas in your existing database. These approaches lack advanced features but may be all you need to start.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that breakdown 👍


This example posts the schema to a registry with version metadata.

Add publication as a deployment step after successful builds, include metadata like git commit and author, and fail deployments if publication fails.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to include the deployment in the "build" process. Maybe it's just a me thing but I would err on the side of explicit:

Suggested change
Add publication as a deployment step after successful builds, include metadata like git commit and author, and fail deployments if publication fails.
Add publication as a deployment step after successful builds but before deployment. Include metadata like git commit and author, and fail deployments if publication fails.


## Automate validation in CI/CD

Schema validation catches problems before they reach production. The `graphql` package provides `findBreakingChanges` and `findDangerousChanges` functions that compare two schemas and return lists of differences.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about findBreakingChanges.

Not related to this PR but would be really cool to have published API docs for graphql-js that we could link here.


This example compares schemas and fails the build when breaking changes appear.

For approved breaking changes, like removing a deprecated field after migration, most teams use one of these approaches:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

run: npm ci

- name: Validate schema syntax
run: npx graphql-inspector validate ./schema/*.graphql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we OK mentioning vendor tools on graphql.org? (same for @apollo/composition a few lines below)

Comment on lines +143 to +147
## Generate reference documentation automatically

GraphQL's introspection makes documentation generation straightforward. Since your schema contains type names, field names, arguments, and descriptions, tools can generate complete API reference docs with litte manual effort.

The key to making GraphQL documentation effective is to make documentation generation automatic. Run it in CI after schema changes merge, and publish to wherever your developers look for docs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this to be done by the registry automagically be having an explorer. Since the registry knows the schema, no need to do custome documentation generation.

### Alert on deprecated field usage
When clients continue using deprecated fields as the removal deadline approaches, send notifications to the responsible teams.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious how much that works in practice. The change is notified through the schema using @deprecated already. Adding another layer of automatic notification feels like duplication of effort.

I get that nudging colleagues is sometimes necessary but if it's an automatic email/notification and the client dev already ignored the @deprecated, there's a very high change they will ignore the notification similarly.

Comment on lines +280 to +282
## Plan for rollbacks
Even with thorough validation, problematic schema changes occasionally reach production. Prepare rollback procedures before you need them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed feelings about this one. I've been telling some users to always fix "onwards".
I mostly consider my API like a database. Some people rely on it and once something reached production, it always go one direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments